function sys=plant(t,x,U)
sys=zeros(12,1);

g=9.81;
m=1.12;
Jr=0.00085;
l=0.23;
Ixx=0.0119;Iyy=0.0119;Izz=0.0223;
OHM=1000;

U1=U(1);U2=U(2);U3=U(3);U4=U(4);
x1=x(1);x2=x(2);x3=x(3);x4=x(4);x5=x(5);x6=x(6);
x7=x(7);x8=x(8);x9=x(9);x10=x(10);x11=x(11);x12=x(12);

a1=(Iyy-Izz)/Ixx;a2=Jr/Ixx;
a3=(Izz-Ixx)/Iyy;a4=-Jr/Iyy;
a5=(Ixx-Iyy)/Izz;b1=l/Ixx;
b2=l/Iyy;b3=l/Izz;
ux=cos(x1)*sin(x3)*cos(x5)+sin(x1)*sin(x5);
uy=cos(x1)*sin(x3)*sin(x5)-sin(x1)*cos(x5);

sys(1)=x2;
sys(2)=x4*x6*a1+x4*a2*OHM+b1*U2;
sys(3)=x4;
sys(4)=x2*x6*a3+x2*a4*OHM+b2*U3;
sys(5)=x6;
sys(6)=x2*x4*a5+b3*U4;
sys(7)=x8;
sys(8)=-g+1/m*(cos(x1)*cos(x3)*U1);
sys(9)=x10;
sys(10)=1/m*(ux*U1);
sys(11)=x12;
sys(12)=1/m*(uy*U1);
end